chrome.devtools.panels.create("Dev tools test",
    "static/icon32.png",
    "bar.html",
    function (panel) {
      panel.onHidden.addListener( function () {
            var message = {
                'type': 'disableBar',
                'dest': chrome.devtools.inspectedWindow.tabId
              };
            chrome.extension.sendRequest(message);
          });
      panel.onShown.addListener( function (window) {
            var message = {
                'type': 'enableBar',
                'dest': chrome.devtools.inspectedWindow.tabId
              };
            chrome.extension.sendRequest(message);
          });
      var request = {
        'type': 'devinit',
        'dest': chrome.devtools.inspectedWindow.tabId
      };
      chrome.extension.sendRequest(request);
    });
